package com.huangjian.localproject.Mockito;

/**
 * @author jianhuang
 * @create 2020/6/10
 */
public class AccountServiceImpl {
    private final AccountDao accountDao;

    public AccountServiceImpl(AccountDao accountDao) {
        this.accountDao = accountDao;
    }

    public String getAccountInfo(String username,String password){
        try{
            Account account = accountDao.getAccount(username, password);
            if(account == null){
                return "login";
            }else {
                return "index";
            }
        }
        catch (Exception e){
            return "505";
        }
    }
}
